#ifndef RTMP_WRITER_HPP
#define RTMP_WRITER_HPP
#include "co_rtmp_pub.hpp"
#include "co_rtmp_session.hpp"
#include "media_packet.hpp"
#include "utils/logger.hpp"
#include <memory>

namespace cpp_streamer
{
    class RtmpWriter : public AvWriterInterface
    {
    public:
        RtmpWriter(CoRtmpSession* session, Logger* logger);
        virtual ~RtmpWriter();

    public:
        virtual int WritePacket(Media_Packet_Ptr) override;
        virtual std::string GetKey() override;
        virtual std::string GetWriterId() override;
        virtual void CloseWriter() override;
        virtual bool IsInited() override;
        virtual void SetInitFlag(bool flag) override;

    private:
        CoRtmpSession* session_ = nullptr;
        Logger* logger_ = nullptr;
        bool init_flag_ = false;
    };

    typedef std::shared_ptr<RtmpWriter> RTMP_WRITER_PTR;
}
#endif